package com.itheima.d1_collection_set;

import com.itheima.d1_collection_set.bean.Student;

import java.util.HashSet;

/**
 * 目标：自定义的类型的对象，比如两个内容一样的学生对象，如果让HashSet集合能够去重复！
 */
public class SetTest3 {
    public static void main(String[] args) {
        HashSet<Student> set = new HashSet<>();
        set.add(new Student("蜘蛛精",22, 169.5));
        set.add(new Student("蜘蛛精",22, 169.5));
        set.add(new Student("蜘精",22, 169.5));
        set.add(new Student("蜘精",22, 169));

        System.out.println("set = " + set);
    }
}
